<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Device extends Model
{
    public $fillable = [
    	'type_id',
    	'code',
    ];

    public function deviceType()
    {
    	return $this->belongsTo('App\Models\DeviceType', 'type_id');
    }

    public function userInfos()
    {
        return $this->belongsToMany('App\Models\UserInfo', 'user_devices', 'device_id', 'user_id');
    }
}
